const { get_fst_file } = require("../utils/file_tool");
const { error, warn, setLastError } = require("../utils/log_tool");
const { BaseCommand } = require("./base");

class FirstExistCommand extends BaseCommand {
    async execute() {
        const data = this.selfData;
        const ret = get_fst_file(data.src, data.real, data.noGlob);
        if (!ret) {
            setLastError(`未找到文件 ${data.src}`);
        }
        return ret;
    }
}

module.exports = {
    FirstExistCommand,
};
